package myPackage;

import java.awt.BorderLayout;
import java.awt.Image;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class ImgReader {
	
	public static void main(String args[]) {
		Image image = null;
		try {
		    // Read from a file
		    File file = new File("D:/JavaEyes/ImageReader/junk.gif");
		    image = ImageIO.read(file);

		    
		} catch (IOException e) {
		}


		JFrame frame = new JFrame();
		JLabel label = new JLabel(new ImageIcon(image));
		frame.getContentPane().add(label, BorderLayout.CENTER);
		frame.pack();
		frame.setVisible(true);

	}

}
